<extend name="../layout" />

<block name="main_content">
    <div class="row-fluid">
        <div class="span3">
            <div class="widget-box">
                <div class="widget-title"> <span class="icon"> <i class="icon-info-sign"></i> </span>
                    <h5>{:L('supplier_info')}</h5>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered table-striped with-check" cellpadding="0" cellspacing="0">
                        <tr>
                            <th style="width:70px;">{:L('rel_company_name')}</th>
                            <td>{$theSupplier.name}</td>
                        </tr>
                        <tr>
                            <th>{:L('phone')}</th>
                            <td>{$theSupplier.phone}</td>
                        </tr>
                        <tr>
                            <th>{:L('contact')}</th>
                            <td>{$theSupplier.contact}</td>
                        </tr>
                        <tr>
                            <th>{:L('address')}</th>
                            <td>{$theSupplier.address}</td>
                        </tr>
                        <tr>
                            <th>{:L('saler_name')}</th>
                            <td>{$theSupplier.User.truename}</td>
                        </tr>
                        <tr>
                            <th>{:L('create_time')}</th>
                            <td>{$theSupplier.dateline|toDate}</td>
                        </tr>
                        <tr>
                            <th>{:L('status')}</th>
                            <td><span class="badge badge-{$theSupplier.status_class}">{:L($theSupplier[status_lang])}</span></td>
                        </tr>
                        <tr>
                            <th colspan='2'>
                                <a href="javascript:edit({$theSupplier.id})" class="btn btn-primary btn-mini">{:L('edit')}</a>
                                <if condition="$theSupplier[user_id] eq $user[id]">
                                    <if condition="$theSupplier[status] eq 1">
                                         <a href="{:U('/CRM/RelationshipCompany/changeStatus/status/0/id/'.$theSupplier[id])}" class="btn btn-mini btn-success">{:L('set_supplier_private')}</a>
                                    <else />
                                         <a href="{:U('/CRM/RelationshipCompany/changeStatus/status/1/id/'.$theSupplier[id])}" class="btn btn-mini btn-danger">{:L('set_supplier_public')}</a>
                                    </if>
                                </if>
                                <a href="javascript:del({$theSupplier.id});" class="btn btn-danger btn-mini">{:L("delete")}</a>
                            </th>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <div class="span9">
            <div class="widget-box">
                <div class="widget-title"> <span class="icon"> <i class="icon-info-sign"></i> </span>
                    <h5>{:L('supplier_linkman')}</h5>
                    <a href="{:U('/CRM/RelationshipCompanyLinkman/add/supplier_id/'.$theSupplier[id])}" class="label label-info">{:L('add_new')}</a>
                    <a href="javascript:history.go(-1);" class="label label-info">{:L('go_back')}</a>
                </div>
                <div class="widget-content nopadding">
                    <table id="" class="table table-bordered table-striped with-check" cellpadding="0" cellspacing="0">
                        <thead>
                            <tr>
                                <th>{:L('id')}</th>
                                <th>{:L('linkman')}</th>
                                <th>{:L('phone1')}</th>
                                <th>{:L('phone2')}</th>
                                <th>{:L('email')}</th>
                                <th>{:L('qq')}</th>
                                <th>{:L('extra')}</th>
                                <th>{:L('create_dateline')}</th>
                                <th>{:L('operation')}</th>
                            </tr>
                        </thead>
                        <tbody>
                            <volist name='theSupplier[SupplierLinkman]' id='cl'>
                                <tr>
                                    <td>{$cl.id}</td>
                                    <td>{$cl.contact}</td>
                                    <td>{$cl.phone1}</td>
                                    <td>{$cl.phone2}</td>
                                    <td>{$cl.email}</td>
                                    <td>{$cl.qq}</td>
                                    <td>{$cl.extra}</td>
                                    <td>{$cl.dateline|toDate}</td>
                                    <td>
                                        <a href="{:U('/CRM/RelationshipCompanyLinkman/edit/id/'.$cl[id])}" class="btn btn-mini btn-primary">{:L('edit')}</a>
                                        <a href="{:U('/CRM/RelationshipCompanyLinkman/foreverdelete/id/'.$cl[id])}" class="btn btn-mini btn-danger" onclick="return confirm('{:L('confirm_delete')}');">{:L('delete')}</a>
                                    </td>
                                </tr>
                            </volist>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</block>